<template>
	<el-config-provider :size="size">
		<router-view />
	</el-config-provider>
</template>

<script setup lang="ts">
import { computed, nextTick, onMounted } from 'vue'
import { RouterView } from 'vue-router'
import { useTitle } from '@vueuse/core'
import store from '@/store'
import { setThemeStyle } from '@/utils/theme/index'
import settings from './utils/settings'

const size = computed(() => store.appStore.componentSize)

// 设置标题
useTitle(settings.title)

onMounted(() => {
	nextTick(() => {
		// 初始化主题样式
		setThemeStyle(store.appStore.theme)
	})
})
</script>
